    package com.singzi.tencent;

    import java.util.Arrays;
    import java.util.Scanner;

    public class Main3 {
        public static void main(String[] args) {
            Scanner scanner = new Scanner(System.in);
            int n = scanner.nextInt();
            int []nums = new int[n];
            for (int i = 0; i < n; i++) {
                nums[i] = scanner.nextInt();
            }
            Arrays.sort(nums);
            int maxMin = 1,maxMax = 1, minNum = 0, maxNum = 0;
            if(nums[0] == nums[n-1]){
                minNum = (n + 1) *n/2;
                maxNum = minNum;

            }
            else{
                for (int i = 1; i < n; i++) {
                    if(nums[i] == nums[0]) maxMin++;
                    else break;
                }
                for (int i = n-2; i >= 0; i--) {
                    if(nums[i] == nums[i+1]) maxMax++;
                    else break;
                }
                int min = Integer.MAX_VALUE;
                for (int i = 1; i < n; i++) {
                    int temp = nums[i] - nums[i - 1];
                    if(temp < min){
                        min = temp;
                    }
                }
                if(min == 0){
                    int zeros = 0;
                    for (int i = 1; i <= n; i++) {
                        if(zeros > 0 && (i == n || nums[i]!=nums[i-1])){
                            minNum +=(zeros + 1) *zeros/2;
                            zeros = 0;
                        }else if(nums[i]==nums[i-1]){
                            zeros++;
                        }

                    }
                    if(nums[n-1] == nums[n-2]){
                        minNum +=(zeros + 1) *zeros/2;
                    }
                }else {
                    for (int i = 1; i < n; i++) {
                        int temp = nums[i] - nums[i - 1];
                        if(temp == min){
                            minNum++;
                        }
                    }
                }

            }

            System.out.print(minNum);
            System.out.print(" ");
            System.out.println(maxNum);
        }
    }
